package com.android.hedgehog;

import java.util.List;

import android.graphics.Color;

import com.android.hedgehog.FreePlayScreen.GameStatus;
import com.android.hedgehog.framework.Game;
import com.android.hedgehog.framework.Graphics;
import com.android.hedgehog.framework.Screen;
import com.android.hedgehog.framework.Input.TouchEvent;

public class PauseScreen extends Screen{
	enum GameStatus { // the game is always in one of these states
		Running, Paused, GameOver
	}
	public Graphics graphics;
	GameStatus status;
	public List<TouchEvent> touchEvents; // needed to handle touch inputs
	public int len; // needed to handle touch inputs

	public PauseScreen(Game game) {
		super(game);
		graphics=game.getGraphics();
		status=GameStatus.Running;
	}

	@Override
	public void update(float deltaTime) {
		Graphics g = game.getGraphics();
		touchEvents = game.getInput().getTouchEvents();

		int len = touchEvents.size();

		for (int i = 0; i < len; i++) {
			TouchEvent event = touchEvents.get(i);
			if (event.type == TouchEvent.TOUCH_UP) { 
				if (event.y > 240 && event.y < 280) { // if "Story Mode" touched
					 game.setScreen(new LevelSelect(game));
					if (Settings.soundEnabled)
						Assets.bitten.play(1);
					return;
				}
				if (event.y > 280 && event.y < 320) { // if "FreePlay" touched
					game.setScreen(new FreePlayMenu(game));
					if (Settings.soundEnabled)
						Assets.bitten.play(1);
					return;
				}
			}
		}
		
	}

	@Override
	public void present(float deltaTime) {
		if(status==GameStatus.Paused){
		graphics.drawSpecialText("RESUME", 160, 180, 80, 2,Color.GREEN);
		graphics.drawSpecialText("QUIT", 160, 300, 80, 2,Color.RED);
		}
		
	}

	@Override
	public void pause() {
		
	}

	@Override
	public void resume() {
	}

	@Override
	public void dispose() {
	}



}
